import http from "@/utils/request"


export let getProductlistApi = (productid?: string, categoryid?: string) => {
    return http.get('/product/get_product', {
        params: {
            productid: productid,
            categoryid: categoryid
        }
    })
}

type IproductData = {
    category_id: string;
    productName: string;
    price: Number;
    description: string;
    inventory: number;
    imageUrl: string;
    product_id: string;
}

export let addProductApi = (data: IproductData) => http.post('/product/add_product', data)


export let modfierProduct = (data: IproductData) => http.post('/product/update_product', data)

export let delProduct = (product_id: string) => http.get('/product/del_product', {
    params: {
        product_id
    }
})